//********************************************/
// Creation History
// Company : HTHK
// Name    : Division.java
// Function : Division Master
// By       : Miranda Lin
// Date     : 11-Aug-2004 CRLOG 1347
/*********************************************/


package admin.system.division;

import com.ffpc.sql.*;

public class Division
   extends DataObject
   implements DivisionBean
{
   private String division_id = null;
   private String division_name = null;
   private String crt_user = null;
   private String crt_date = null;
   private String upd_user = null;
   private String upd_date = null;
   private Column ColDivisionId = null;
   private Column ColDivisionName = null;
   private Column ColCrtUser = null;
   private Column ColCrtDate = null;
   private Column ColUpdUser = null;
   private Column ColUpdDate = null;
   /**
    * Constructor
    */
   public Division()
   {
       ColDivisionId = new Column(0,"division_id",Column.Types.string,null,10,false);
       ColDivisionName = new Column(1,"division_name",Column.Types.string,null,50,false);
       ColCrtUser = new Column(2,"crt_user",Column.Types.string,null,10,true);
       ColCrtDate = new Column(3,"crt_date",Column.Types.time,null,7,true);
       ColUpdUser = new Column(4,"upd_user",Column.Types.string,null,10,true);
       ColUpdDate = new Column(5,"upd_date",Column.Types.time,null,7,true);
   }

   // functions belongs to DivisionBean interface

   @Override
public void setDivision_id(String division_id)
   {       this.division_id = this.setAttribute(ColDivisionId,division_id);
   }

   @Override
public String getDivision_id()
   {       return this.division_id==null?"":this.division_id;
   }

   @Override
public void setDivision_name(String division_name)
   {       this.division_name = this.setAttribute(ColDivisionName,division_name);
   }

   @Override
public String getDivision_name()
   {       return this.division_name==null?"":this.division_name;
   }

   @Override
public void setCrt_user(String crt_user)
   {       this.crt_user = this.setAttribute(ColCrtUser,crt_user);
   }

   @Override
public String getCrt_user()
   {       return this.crt_user==null?"":this.crt_user;
   }

   @Override
public void setCrt_date(String crt_date)
   {       this.crt_date = this.setAttribute(ColCrtDate,crt_date);
   }

   @Override
public String getCrt_date()
   {       return this.crt_date==null?"":this.crt_date;
   }

   @Override
public void setUpd_user(String upd_user)
   {       this.upd_user = this.setAttribute(ColUpdUser,upd_user);
   }

   @Override
public String getUpd_user()
   {       return this.upd_user==null?"":this.upd_user;
   }

   @Override
public void setUpd_date(String upd_date)
   {       this.upd_date = this.setAttribute(ColUpdDate,upd_date);
   }

   @Override
public String getUpd_date()
   {       return this.upd_date==null?"":this.upd_date;
   }

   // belongs to row interface

   @Override
public Column[] createColumns()
   {
       Column[] cols = new Column[6];
       cols[0] = ColDivisionId.clone(null);
       cols[1] = ColDivisionName.clone(null);
       cols[2] = ColCrtUser.clone(null);
       cols[3] = ColCrtDate.clone(null);
       cols[4] = ColUpdUser.clone(null);
       cols[5] = ColUpdDate.clone(null);
       return cols;
   }

   // super's abstract methods

   @Override
public String getTableName()
   {
       return "JIS.JIS_S_DIVISION";
   }

   @Override
protected String[] getKeyColumnNames()
   {
       String[] list = {
                         "division_id"
                       };
       return list;
   }

   @Override
protected String[] getUpdatableColumnNames()
   {
       String[] list = {
                         "division_name"
                         ,"crt_user"
                         ,"crt_date"
                         ,"upd_user"
                         ,"upd_date"
                       };
       return list;
   }

   @Override
protected void retrieveColumnValues()
   {
       this.division_id = this.retrieveColumnValue("division_id");
       this.division_name = this.retrieveColumnValue("division_name");
       this.crt_user = this.retrieveColumnValue("crt_user");
       this.crt_date = this.retrieveColumnValue("crt_date");
       this.upd_user = this.retrieveColumnValue("upd_user");
       this.upd_date = this.retrieveColumnValue("upd_date");
   }
}

